package com.iplatform.file;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author MrRed
 * @date 2020-09-30
 */
@SpringBootApplication(/*exclude= {DataSourceAutoConfiguration.class}*/)
@EnableDiscoveryClient
@EnableFeignClients
@EnableSwagger2
@MapperScan("com.iplatform.file.function.**.dao")
@ComponentScans(value = {@ComponentScan({"com.iplatform.commons","com.iplatform.file"})})
public class FileApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(FileApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(FileApplication.class);
    }
    //注册RestTemplate

    @Bean
    public RestTemplate restTemplate(){

        RestTemplate restTemplate=new RestTemplate();

        return restTemplate;

    }
}
